<?php
class Bliss_DataReport_Format_Hyperlink extends Bliss_DataReport_Format_Abstract
{
	protected static $_front;

	protected function format($value)
	{
		$path	= trim($this->options->path, '/');
		$url	= $this->getFront()->getBaseUrl().'/'.sprintf($path, $value);
		$text	= isset($this->options->text) ? sprintf($this->options->text, $value) : $value;

		return '<a href="'.$url.'">'.$text.'</a>';
	}

	protected function getFront()
	{
		if(!isset(self::$_front)) {
			self::$_front	= Zend_Controller_Front::getInstance();
		}
		return self::$_front;
	}
}
?>